package com.tqfframe.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.tqfframe.dubboapi.user.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 唐祺峰
 * @Date: 2020/12/4 0004 14:39
 * @Version 1.0
 */
@RestController
public class TestController {

    @Reference
    UserService userService;

    /**
     *  localhost:8081/getUserInfo?id=1111
     * @param userId
     * @return
     */
    @ResponseBody   //以json格式返回
    @RequestMapping("/getUserInfo")
    public String getUserInfo(@RequestParam("id") String userId){
        return userService.getUserInfo(userId);
    }

}
